package com.ailesson.common.core;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * 获取登录用户信息类
 *
 */
public class AuthContextHolder {

    //后台管理用户id
    private static TransmittableThreadLocal<Long> adminId = new TransmittableThreadLocal<Long>();
    //会员用户id
    private static TransmittableThreadLocal<Long> userId = new TransmittableThreadLocal<Long>();

    public static Long getAdminId() {
        return adminId.get();
    }

    public static void setAdminId(Long _adminId) {
        adminId.set(_adminId);
    }

    public static Long getUserId(){
        return userId.get();
    }

    public static void setUserId(Long _userId){
        userId.set(_userId);
    }

    public static void removeUserId(){
        userId.remove();
    }

    public static void removeAdminId(){
        adminId.remove();
    }

}
